<template>
<div class="sql-list">
    <div class="sql-list-item" v-for="(sub, i) in tableList" :key="i">
        <span class="item-name">{{sub.portVariable}}</span>
        <el-tooltip v-if="sub.srcNodeName" effect="dark" :content="sub.srcNodeName" placement="top">
            <span class="item-value">{{sub.srcNodeName || '暂无'}}</span>
        </el-tooltip>
        <span v-else class="item-value">{{sub.srcNodeName || '暂无'}}</span>
    </div>
    <span v-if="tableList.length===0" style="color:#919297;font-size:12px;">暂无数据</span>
</div>
</template>

<script>
export default {
    name: 'TableList',
    props: {
        tableList: {
            type: Array,
            default: () => {
                return []
            }
        }
    }
}
</script>

<style lang="less" scoped>
.sql-list {
    max-height: 150px;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 4px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #ebeef5;

    .sql-list-item {
        height: 27px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid #ebeef5;
        font-size: 12px;
        padding-right: 5px;
        padding-left: 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        .item-name {
            color: #333333;
            padding-right: 10px;
        }

        .item-value {
            color: #999999;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }

    .sql-list-item:last-child {
        border: none;
    }
}
</style>
